/**
*   \file   closestpoint.h
*   \author Dave Reid
*   \brief  Header file for algorithms involving finding the closest point on an
*           object to a point.
*/
#ifndef __EAGL_CLOSESTPOINT_H_
#define __EAGL_CLOSESTPOINT_H_

#include "ClosestPoint/segmenttopoint.h"
#include "ClosestPoint/aabbtopoint.h"

namespace eagl
{

/**
*   \brief              Find the closest point on an object to a point.
*   \param  object [in] The object.
*   \param  point  [in] The point.
*   \return             The closest point on \c object to \c point.
*/
inline Point3 closestpoint_topoint(const Segment3 &line, const Point3 &point)
{
    return closestpoint_segmenttopoint(line.getEndPoint().getPosition(), line.getEndPoint().getPosition(), point.getPosition());
}

}

#endif  // __EAGL_CLOSESTPOINT_H_